import router from "./router";
import store from './store'

// 引入NProgress
import NProgress from 'nprogress'
// 引入nprogress样式文件
import'nprogress/nprogress.css'
// import {constantRouterMap,} from './router'
NProgress.configure({ easing: 'ease', speed: 500, showSpinner: false })
router.beforeEach((to,from,next)=>{
    NProgress.start()
    store.dispatch("permission/dynamicRoute")
    next()
})

router.afterEach(()=>{
    NProgress.done()
})